/* GUI CONVERTED from rsrp08.p (converter v1.75) Tue Nov  7 07:30:19 2000 */
/* rsrp08.p - Release Management Supplier Schedules                          */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                       */
/* All rights reserved worldwide.  This is an unpublished work.              */
/*F0PN*/ /*V8:ConvertMode=FullGUIReport                                      */
/* REVISION: 7.3    LAST MODIFIED: 12/10/92           BY: WUG *G462*         */
/* REVISION: 7.3    LAST MODIFIED: 01/12/95           BY: srk *G0C1*         */
/* REVISION: 7.3    LAST MODIFIED: 04/21/97           BY: *G2MD* Aruna Patil */
/* REVISION: 8.6    LAST MODIFIED: 10/21/97           BY: bvm *K140*         */
/* REVISION: 8.6E   LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane           */
/* REVISION: 8.6E   LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan          */
/* REVISION: 9.1    LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane    */
/* REVISION: 9.1    LAST MODIFIED: 08/12/00   BY: *N0KP* myb                 */
/* REVISION: 9.1    LAST MODIFIED: 09/11/00   BY: *N0RT* Mudit Mehta         */


/*GUI global preprocessor directive settings */
&GLOBAL-DEFINE PP_PGM_RP TRUE
&GLOBAL-DEFINE PP_ENV_GUI TRUE


/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

          {mfdtitle.i "b+ "}

/* ********** Begin Translatable Strings Definitions ********* */

/*N0RT***********BEGIN COMMENTING*************
 * &SCOPED-DEFINE rsrp08_p_1 "2 - By Item, Ship-to, Supplier, PO"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE rsrp08_p_2 "3 - By PO, Item"
 * /* MaxLen: Comment: */
 *
 * &SCOPED-DEFINE rsrp08_p_3 "1 - By Ship-to, Supplier, Item, PO"
 * /* MaxLen: Comment: */
 *N0RT***********END COMMENTING************* */

&SCOPED-DEFINE rsrp08_p_4 "Sort Option"
/* MaxLen: Comment: */

&SCOPED-DEFINE rsrp08_p_5 "Receipt Date"
/* MaxLen: Comment: */

&SCOPED-DEFINE rsrp08_p_6 "Report Shipments"
/* MaxLen: Comment: */

&SCOPED-DEFINE rsrp08_p_7 "Report Returns"
/* MaxLen: Comment: */

&SCOPED-DEFINE rsrp08_p_8 "Report Cum Adjs/Resets"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

/* SHIPMENT HISTORY REPORT */

/*K140*/ define new shared variable supplier_from like po_vend.
/*K140*/ define new shared variable supplier_to like po_vend.
/*K140*/ define new shared variable shipto_from like po_ship.
/*K140*/ define new shared variable shipto_to like po_ship.
/*K140*/ define new shared variable part_from like pod_part.
/*K140*/ define new shared variable part_to like pod_part.
/*K140*/ define new shared variable po_from like po_nbr.
/*K140*/ define new shared variable po_to like po_nbr.
/*K140*/ define new shared variable buyer_from like po_buyer.
/*K140*/ define new shared variable buyer_to like po_buyer.
/*K140*/ define new shared variable date_from as date label {&rsrp08_p_5}.
/*K140*/ define new shared variable date_to as date.
/*K140*/ define new shared variable rct_trans like mfc_logical
                                              label {&rsrp08_p_6} initial yes.
/*K140*/ define new shared variable rtn_trans like mfc_logical
                                              label {&rsrp08_p_7} initial yes.
/*K140*/ define new shared variable cum_trans like mfc_logical
                                              label {&rsrp08_p_8} initial yes.
/*K140*/ define new shared variable sortoption as integer label {&rsrp08_p_4}
                                               format "9" initial 1.
/*N0RT*
 * /*K140*/  define new shared variable sortextoption as character extent 3
 *        format "x(34)"  initial [
 *        {&rsrp08_p_3},
 *        {&rsrp08_p_1},
 *        {&rsrp08_p_2}].
 *N0RT*/
/*N0RT*/ define new shared variable sortextoption as character extent 3
                                                  format "x(34)".

/*K140*/ define variable schtype as integer initial 1.

/*N0RT************* SET INITIAL VALUSES ************* */
/*N0RT*/ sortextoption[1] = "1 - " + getTermLabel("BY",2) + " " +
                             getTermLabel("SHIP-TO",7) + ", " +
                             getTermLabel("SUPPLIER",8) + ", " +
                             getTermLabel("ITEM",4) + ", " +
                             getTermLabel("PURCHASE_ORDER",2).
/*N0RT*/ sortextoption[2] = "2 - " + getTermLabel("BY",2) + " " +
                             getTermLabel("ITEM",4) + ", " +
                             getTermLabel("SHIP-TO",7) + ", " +
                             getTermLabel("SUPPLIER",8) + ", " +
                             getTermLabel("PURCHASE_ORDER",2).
/*N0RT*/ sortextoption[3] = "3 - " + getTermLabel("BY",2) + " " +
                             getTermLabel("PURCHASE_ORDER",2) + ", " +
                             getTermLabel("ITEM",4).
         
/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
            
 RECT-FRAME       AT ROW 1.4 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1   COLUMN 3 NO-LABEL
 SKIP(.1)  /*GUI*/
po_from              colon 20
            po_to                colon 50 label {t001.i}
            part_from            colon 20
            part_to              colon 50 label {t001.i}
            supplier_from        colon 20
            supplier_to          colon 50 label {t001.i}
            shipto_from          colon 20
            shipto_to            colon 50 label {t001.i}
            buyer_from           colon 20
            buyer_to             colon 50 label {t001.i}
            date_from      colon 20
            date_to        colon 50 label {t001.i}
            skip(1)
            rct_trans      colon 30
            rtn_trans      colon 30
            cum_trans      colon 30
            skip(1)
            sortoption           colon 30
            sortextoption[1]     at 40 no-label
            sortextoption[2]     at 40 no-label
            sortextoption[3]     at 40 no-label
            skip(1)
          SKIP(.4)  /*GUI*/
with frame a side-labels width 80 attr-space NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER.
 F-a-title = &IF (DEFINED(SELECTION_CRITERIA) = 0)
  &THEN " Selection Criteria "
  &ELSE {&SELECTION_CRITERIA}
  &ENDIF .
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:WIDTH-PIXELS in frame a =
  FONT-TABLE:GET-TEXT-WIDTH-PIXELS(
  RECT-FRAME-LABEL:SCREEN-VALUE in frame a + " ", RECT-FRAME-LABEL:FONT).
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5. /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



         /* SET EXTERNAL LABELS */
         setFrameLabels(frame a:handle).

/*K140*/ {wbrp01.i}

/*G0C1*  repeat with frame a: */
/*G0C1*/ 
/*GUI*/ {mfguirpa.i true  "printer" 132 }

/*GUI repeat : */
/*GUI*/ procedure p-enable-ui:

/*K140*     disp sortextoption */
/*K140*/    display sortextoption
/*G0C1*/    with frame a.

            if po_to = hi_char then po_to = "".
            if part_to = hi_char then part_to = "".
            if supplier_to = hi_char then supplier_to = "".
            if shipto_to = hi_char then shipto_to = "".
            if buyer_to = hi_char then buyer_to = "".

/*G2MD*     if date_from = 01/01/1960 then date_from = ?. */
/*G2MD*     if date_to = 12/31/2100 then date_to = ?.     */

/*G2MD*/    if date_from = low_date then date_from = ?.
/*G2MD*/    if date_to = hi_date then date_to = ?.

/*K140*/    if c-application-mode <> 'web' then
            
run p-action-fields (input "display").
run p-action-fields (input "enable").
end procedure. /* p-enable-ui, replacement of Data-Entry GUI*/

/*GUI*/ procedure p-report-quote:


/*K140*/    {wbrp06.i &command = update
                      &fields = "  po_from po_to part_from part_to
                       supplier_from supplier_to shipto_from shipto_to
                       buyer_from buyer_to date_from date_to rct_trans rtn_trans
                       cum_trans sortoption "
                      &frm = "a"}

/*K140*/    if (c-application-mode <> 'web') or
/*K140*/       (c-application-mode = 'web' and
/*K140*/       (c-web-request begins 'data'))
            then do:

               bcdparm = "".
               {mfquoter.i po_from     }
               {mfquoter.i po_to       }
               {mfquoter.i part_from   }
               {mfquoter.i part_to     }
               {mfquoter.i supplier_from}
               {mfquoter.i supplier_to }
               {mfquoter.i shipto_from }
               {mfquoter.i shipto_to   }
               {mfquoter.i buyer_from  }
               {mfquoter.i buyer_to    }
               {mfquoter.i date_from   }
               {mfquoter.i date_to     }
               {mfquoter.i rct_trans  }
               {mfquoter.i rtn_trans   }
               {mfquoter.i cum_trans   }
               {mfquoter.i sortoption  }

               if po_to = "" then po_to = hi_char.
               if part_to = "" then part_to = hi_char.
               if supplier_to = "" then supplier_to = hi_char.
               if shipto_to = "" then shipto_to = hi_char.
               if buyer_to = "" then buyer_to = hi_char.

/*G2MD*        if date_from = ? then date_from = 01/01/1960. */
/*G2MD*        if date_to = ? then date_to = 12/31/2100.     */

/*G2MD*/       if date_from = ? then date_from = low_date.
/*G2MD*/       if date_to = ? then date_to = hi_date.

/*K140*/    end.

            /* SELECT PRINTER */
            
/*GUI*/ end procedure. /* p-report-quote */
/*GUI - Field Trigger Section */

/*GUI MFSELxxx removed*/
/*GUI*/ procedure p-report:
/*GUI*/   {gpprtrpa.i  "printer" 132}
/*GUI*/   mainloop: do on error undo, return error on endkey undo, return error:



            {mfphead2.i}

            if sortoption = 1 then do:
               {gprun.i ""rsrp08a.p""}
            end.
            else
            if sortoption = 2 then do:
               {gprun.i ""rsrp08b.p""}
            end.
            else
            if sortoption = 3 then do:
               {gprun.i ""rsrp08c.p""}
            end.

            
/*GUI*/ {mfguitrl.i} /*Replace mfrtrail*/

/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/


         end.

/*K140*/ {wbrp04.i &frame-spec = a}

/*GUI*/ end procedure. /*p-report*/
/*GUI*/ {mfguirpb.i &flds=" po_from po_to part_from part_to supplier_from supplier_to shipto_from shipto_to buyer_from buyer_to date_from date_to rct_trans rtn_trans cum_trans sortoption  "} /*Drive the Report*/
